'''函数'''

# 猴子吃桃
# def monkey_eat(day):
#     if day == 10:
#         return 1
#     else:
#         return 2*(monkey_eat(day+1)+1)
#
#
# print("猴子吃桃，第一天有：",monkey_eat(1))


# def peach_count(c):
#     return (c+1)*2
# num=1
# day=10
# while day>1:
#     day -=1
#     num = peach_count(num)
#     print("第",day,"的桃子数量是：",num)
#
#

# 1000内的完全数

def is_preferce(n):
    l=[]
    for i in range(1,n):
        if n%i == 0:
            l.append(i)
            
    if sum(l) == n:
        return True
    else:
        return False


l=[]
for n in range(1,1001):
    if is_preferce(n):
        l.append(n)
print(l)
